ResetList
ResetList List()
 
Parameters:

    List() = The Type list handle you wish to reset
Returns: NONE
 

      The ResetList() function resets a current position index to the first link within a typed linked list variable.




FACTS:


      * ResetList is short hand for SetListPos GetListFirst(Mylist())

      * Don't know what a linked list is ?, make sure you read the LinkedLists tutorial then.





Mini Tutorial:


      This example creates a list of three people, then runs through the list manually and displays each persons names and their list position.

  
; Declare the "Person" user defined type.
  Type Person
   ; These Fields will hold this persons name
     FirstName$
     SurName$
  EndType
  
;  Dimension the Friends variable of type Person,
; with linked list support
  Dim  Friends As Person List
  
  
; Add a person (Billy) to Friends list
  Friends= New Person
  Friends.FirstName$ ="Billy"
  Friends.Surname$ ="Citizen"
  
  
; Add another person (Sally) to Friends list
  Friends= New Person
  Friends.FirstName$      ="Sally"
  Friends.Surname$           ="Stevens"
  
; Add another person (Sally) to Friends list
  Friends= New Person
  Friends.FirstName$      ="Olivia"
  Friends.Surname$           ="Dude"
  
  
  
; Reset the List current index of this list ot the FIRST
; in the list
  ResetList Friends()
  
;Enter a while loop, but only while the current list position
; ifn't at the end of the list
  While Not EndOfList(Friends())
     
   ; Display this persons name
     Print Friends.FirstName$+" "+Friends.Surname$
     Print ""
     
   ; Move the current list pointer to the next link
   ; in the list.
     StepList Friends()
     
  EndWhile
  
; display the screen and wait for a key press
  Sync
  WaitKey
  
  




      This example would output.

  
  Olivia Dude
  
  Sally Stevens
  
  Billy Citizen
  
  

 
Related Info: Each | EndOfList | GetListPos | LinkedLists | List | NewList | StepList :
 


(c) Copyright 2002 - 2024 - Kevin Picone - PlayBASIC.com